/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package trad;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

/**
 *
 * @author administrator
 */
@WebService()
public class Traduction {

    /**
     * Web service operation
     */
    @WebMethod(operationName = "traduire")
    public String traduire(@WebParam(name = "lien")
    String lien, @WebParam(name = "langueDep")
    String langueDep, @WebParam(name = "langueArr")
    String langueArr) {
        //TODO write your implementation code here:
        try 
        {
            String requete = "";
            requete = "http://fr.babelfish.yahoo.com/translate_url?doit=done&tt=url&intl=1&fr=bf-home&trurl=" + lien + "&lp=" + langueDep + "_" + langueArr + "&btnTrUrl=Traduire";
            return requete;
        }
        catch (Exception e)
        {
            return "-1";
        }
    }

}
